-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
senpai: use SCFG format #4086
senpai: use SCFG format #4086
Conversation
modules/programs/senpai.nix
Outdated
xdg.configFile."senpai/senpai.yaml".source = | ||
cfgFmt.generate "senpai.yaml" cfg.config; | ||
xdg.configFile."senpai/senpai.scfg".text = let | ||
toSCFG' = v: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an inline generator for the (pretty custom) SCFG format. Would a PR to add this to generators.nix be more appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in this PR.
Fix NixOS/nixpkgs#148667 introducing the backwards-incompatible change of using the SCFG format (https://git.sr.ht/~emersion/scfg). Signed-off-by: Jack Leightcap <jack@leightcap.com>
I'd really rather keep the |
The renamed options can have |
remove @malte-v: #4086 (comment) add jleightcap (commit author) Signed-off-by: Jack Leightcap <jack@leightcap.com>
nicknames 16 | ||
} | ||
|
||
password-cmd gopass show irc/guest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be password-cmd "gopass show irc/guest"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, SCFG doesn't quote its strings. See: https://git.sr.ht/~taiite/senpai/tree/master/item/doc/senpai.5.scd#L199
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, but password-cmd
is intentionally parsed as a list of arguments to be fed to an execve
-like interface, rather than a single shell command string: https://git.sr.ht/~taiite/senpai/tree/master/item/config.go#L199-214
The option should reflect that by having type nullOr (listOf str)
. This will avoid giving users the illusion that they can use shell syntax and quoting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I understand. Thank you for the well reasoned response -- an option wrapping execve
as a list of strings is much more correct 🙂
As far as I can tell, Maybe just add |
Signed-off-by: Jack Leightcap <jack@leightcap.com>
Signed-off-by: Jack Leightcap <jack@leightcap.com>
two prior config choices: - `addr` - `nick` are renamed to match expected keys from upstream. Signed-off-by: Jack Leightcap <jack@leightcap.com>
removed upstream. move into `extraConfig` with `tls` option. Signed-off-by: Jack Leightcap <jack@leightcap.com>
Unfortunately existing Let me know if more testing is warranted -- since |
Signed-off-by: Jack Leightcap <jack@leightcap.com>
Signed-off-by: Jack Leightcap <jack@leightcap.com>
Signed-off-by: jleightcap <jack@leightcap.com>
imports = [ | ||
(mkRenamedOptionModule [ "programs" "senpai" "addr" ] [ | ||
"programs" | ||
"senpai" | ||
"address" | ||
]) | ||
(mkRenamedOptionModule [ "programs" "senpai" "nick" ] [ | ||
"programs" | ||
"senpai" | ||
"nickname" | ||
]) | ||
(mkChangedOptionModule [ "programs" "senpai" "no-tls" ] [ | ||
"programs" | ||
"senpai" | ||
"tls" | ||
] (config: !config.programs.senpai.no-tls)) | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly this is not going to work because of NixOS/nixpkgs#96006. (Well, and also because this is defined in a let in
but not used)
I think the best we can do for now is add assertions that the old options aren't used...
Sorry for leading you to a wrong track, this corner of the module system isn't quite ready yet.
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting. If you are the original author of the PR
If you are not the original author of the PR
|
Description
Closes #2534.
Checklist
Change is backwards compatible.
no-tls
option. upstream config now exposes justtls
with a reasonable default.Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module